package com.vincent.common.enums;

/**
 * @author Vincent
 * @description Session中的key
 * @version 1.0
 */
public enum SessionEnum {
    MEMBER("member"),ADMIN("admin"),AUTHCODE("authcode"),ERRORMSG("error"),SUCCESSMSG("success");

    private String code;

    SessionEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    /**
     * 获取所有的session的key
     * @return session的key集合
     */
    public static String[] getAllSessionName(){
        SessionEnum[] sessionEnums = SessionEnum.values();
        int length = sessionEnums.length;
        String[] strings = new String[length];
        for(int i=0;i<length;i++){
            strings[i]=sessionEnums[i].getCode();
        }
        return strings;
    }
}
